<div class="container">
	<ol class="breadcrumb">
		<li><?php echo anchor('', 'Início'); ?></li>
		<li><?php echo anchor('parasuaempresa', 'Para Sua Empresa'); ?></li>
		<li class="active">Cardápio</li>
	</ol>
</div>

<div class="container">

	<div class="row">
		<?php $this->load->view('parasuaempresa/_sidebar'); ?>

		<div class="col-lg-9 col-md-9">
			
			<h3 class="titulos">
				<div class="pull-right">
					<a href="<?php echo site_url('parasuaempresa/cardapio/cadastrar_categoria'); ?>" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus-sign"></span> Nova categoria</a>	
				</div>
				Meu Cardápio	
				<div class="clearfix"></div>
			</h3>

			<?php
				if(!isset($categorias) || count($categorias) == 0){
			?>
				<div class="well">Nenhuma categoria cadastrada.</div>
			<?php
				}else{
					foreach($categorias as $cat){
			?>

				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title  cardapio-categoria">
							<div class="pull-right">
								<div class="btn-group">
									<a href="<?php echo site_url('parasuaempresa/cardapio/cadastrar_item/'.$cat->getCodCategoria()); ?>" class="btn btn-xs btn-default">
										<span class="glyphicon glyphicon-plus-sign"></span> Novo item
									</a>
									<a href="<?php echo site_url('parasuaempresa/cardapio/editar_categoria/'.$cat->getCodCategoria()); ?>" class="btn btn-xs btn-default">
										<span class="glyphicon glyphicon-file"></span> Editar categoria
									</a>	
								</div>
							</div>
							<?php echo $cat->getDescCategoria(); ?>
							<div class="clearfix"></div>
						</div>
					</div>

					<div class="table-responsive">
						<table class="table">
							<?php
								$items = $cat->getItems();

								if(count($items) == 0){
							?>
								<tr>
									<td>Nenhum item cadastrado.</td>
								</tr>
							<?php
								}else{
							?>
								<tr>
									<th style="width:20px;"></th>
									<th>Descrição</th>
									<th style="width: 75px;">Ações</th>
								</tr>
								<?php
									foreach($items as $item) {
								?>
								<tr>
									<td class="<?php echo $item->getItemIndisponivel() ? 'cardapio-inativo' : 'cardapio-ativo'; ?>">
										<span class="glyphicon glyphicon-stop"></span>
									</td>
									<td><?php echo $item->getDescItem(); ?></td>
									<td>
										<?php echo anchor('parasuaempresa/cardapio/editar_item/'.$item->getCodCategoria() . '/' . $item->getCodItem(),'Alterar'); ?>
									</td>
								</tr>
								<?php
									}
								?>								
							<?php
								}
							?>
						</table>
					</div>
				</div>
			<?php
					}
				}
			?>
			<div class="clearfix"></div>
		</div>
	</div>

</div>